package org.agile.grenoble.configuration;

import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;

public class Messages {
	private static final String BUNDLE_NAME = "org.agile.grenoble.configuration.messages"; //$NON-NLS-1$

	private static ResourceBundle RESOURCE_BUNDLE = null ; 

	private Messages() {		
	}

	public static String getString(String key) {
		if (RESOURCE_BUNDLE == null ) {
			RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME,Locale.getDefault());
		}
		try {
			//System.out.println("Locale.getDefault() => " + Locale.getDefault());
			//System.out.println("Locale used " + RESOURCE_BUNDLE.getLocale()) ;
			return RESOURCE_BUNDLE.getString(key);
		} catch (MissingResourceException e) {
			return '!' + key + '!';
		}
	}
}
